package com.xyrl.third.aliyun.configuration;

import com.xyrl.third.aliyun.config.AliYunProperties;
import com.xyrl.third.aliyun.service.AliOssService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(AliOssService.class)
@EnableConfigurationProperties(AliYunProperties.class)
public class AliOssAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(AliOssService.class)
    public AliOssService aliyunAliOssService() {
        AliOssService aliOssService = new AliOssService();
        return aliOssService;
    }
}
